<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"  %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>事项列表</title>
   	<base href="<%=basePath%>">
    <%@ include file="/main/main_css.jsp" %>
    <%@ include file="/main/main_js.jsp" %>
</head>
<body>
    <!--  -->
    <div class="all-wrapper">
        <div class="row com-header text-center">
            <span>鹰潭市行政服务中心</span>
        </div>
        <div class="row main-content file-upload">
            <div class="row" >
                <div class="time-count pull-right">
                    <span>剩余</span> <span id="time" class="text-red"></span> <span>秒</span>
                </div>
            </div>
            <div class="row">
            	<div class="col-md-24">
                	<h1>${orItems.getTAG_NAME()}</h1>
                </div>
            </div>
            <c:if test="${itemsList.size()>0 }">
            <c:forEach var="items" items="${itemsList }">
            <div class="row el">
                <div class="col-md-24">
                	<a href="/smartTerminal/getitem?itemName=${items.getITEMNAME() }&type=${type }&itemId=${items.getITEMID() }">
                    	<span class="list-name">${items.getITEMNAME() }  </span> 
                    </a>
                   <span class="sm-list-name">办理机构：${items.getNORMACCEPTDEPART() }</span>
                </div>
            </div>
           </c:forEach>
           </c:if>
        </div>
        <div class="row current-page">
                    <div class="pull-right">
					
					<c:if test="${siteItem.getCurrentpage() >1 }">
                    	<button class="btn btn-lg btn-warning" type="button"  onclick="lastpage()">
                    	上一页
                    	</button>
                    </c:if>	
	                <c:if test="${siteItem.getCurrentpage() <=1}">
	                   	<button class="btn btn-lg btn-warning" type="button">
                    	上一页
                    	</button>
	                </c:if>
	                
                    </button>
                    
                    <span class="txt-md">${siteItem.getCurrentpage() }/${siteItem.getCurrentRows() }</span>
                   
                    <c:if test="${siteItem.getCurrentpage()<siteItem.getCurrentRows() }">
                    	<button class="btn btn-lg btn-warning" type="button" onclick="nextpage()">
                    	下一页
                    	</button>
                    </c:if>	
                    <c:if test="${siteItem.getCurrentpage()>=siteItem.getCurrentRows() }">
                    	<button class="btn btn-lg btn-warning" type="button">
                    		下一页
                    	</button>
                    </c:if>
                    </div>
            </div>
	      <form id="pageForm" action="/smartTerminal/getSiteItemList" method="post">
			<input type="hidden" id="siteName" name="siteName" value="${siteName}"/>
	      	<input type="hidden" id="currentpage" name="currentpage" value="${siteItem.getCurrentpage()}"/>
	      	<input type="hidden" id="pagesize" name="pagesize" value="${siteItem.getPagesize()}"/>
	      </form>
        <div class="row footer">
            <a class="btn btn-success btn-lg" href="loginOut" role="button"><i class="fa fa-reply"></i>返回首页</a>
            <a class="btn btn-primary btn-lg" href="/smartTerminal/getSiteList" role="button"><i class="fa fa-arrow-left"></i>上一步</a>
        </div>
    </div></div>
   <form id="loginOut" action="loginOut"></form>
</body>
<script src="static/js/common.js" type="text/javascript"></script>
<script >
		var count = 119;
		function countdown(){
			$("#time").text(count);
			if(count > 0){
				window.setTimeout("countdown()",1000);
				count --;
			}else{
				$("#loginOut").submit();
			}
		}
		countdown();

		function lastpage(){
			var currentpage = ${siteItem.getCurrentpage() };
			--currentpage;
			$("#currentpage").val(currentpage);
			$("#pageForm").submit();
		}
		function nextpage(){
			var currentpage = ${siteItem.getCurrentpage() };
			++currentpage;
			$("#currentpage").val(currentpage);
			$("#pageForm").submit();
		}
</script>
<!-- 添加动画 -->
<script type="text/javascript">

	var index = layer.load(3, {
	    shade: [0.3,'#000'] //0.1透明度的白色背景  
	});
	setTimeout(function(){
	    layer.close(index);
	},500);

	 var winH = $(document).height();
     var mainH = winH -250;
     $('.main-content').height(mainH);
</script>

</html>
